<template>
  <div>
    <div class="head">
      <p class="text">我的关注</p>
      <van-icon
        @click="onClickLeft()"
        size="20"
        color="whitesmoke"
        name="arrow-left"
        class="icon"
      />
    </div>
    <van-tabs
      background="#6c90f3"
      title-inactive-color="white"
      class="index_tab"
      v-model="active"
      @click="onClick"
      sticky
    >
      <van-tab title="应用">
        <!-- <div class="msg">
            注意：修改if条件为“如果返回数据为空”
            <el-link type="info" disabled v-if="1===1" class="null">您还没有关注的应用</el-link>
          </div> -->
        <div class="concla1">
          <br />
          <div class="concla1-1" v-for="(item, index) in list" :key="index">
            <van-image
              radius="10"
              class="guess_like_img"
              width="50"
              height="50"
              :src="item.app_image_road"
            />
            <span class="concla1-1-1">{{ item.app_name }}</span>
            <span class="concla1-1-2"
              >下载次数：{{ item.app_downloding_times }}</span
            >
            <van-button class="conbtn1" size="small" round type="info"
              >下载</van-button
            >
          </div>
        </div>
      </van-tab>

      <!-- 已关注数码模块 -->
      <van-tab title="数码">
        <!-- <div class="msg">
            注意：修改if条件为“如果返回数据为空”
            <el-link type="info" disabled v-if="1===1" class="null">您还没有关注的数码</el-link>
            </div> -->
        <div class="concla1">
          <br />
          <div
            class="concla1-1"
            v-for="(item, index) in digitalList"
            :key="index"
          >
            <van-image
              radius="10"
              class="guess_like_img"
              width="50"
              height="50"
              :src="item.app_image_road"
            />
            <span class="concla1-1-1">{{ item.app_name }}</span>
            <span class="concla1-1-2"
              >下载次数：{{ item.app_downloding_times }}</span
            >
            <van-icon name="arrow" class="conbtn1" />
          </div>
        </div>
      </van-tab>

      <!-- 已关注话题模块 -->
      <van-tab title="话题">
        <!-- <div class="msg">
            注意：修改if条件为“如果返回数据为空”
            <el-link type="info" disabled v-if="1===1" class="null">您还没有关注的话题</el-link>
            </div> -->
        <div class="concla1">
          <br />
          <div
            class="concla1-1"
            v-for="(item, index) in topicList"
            :key="index"
          >
            <van-image
              radius="10"
              class="guess_like_img"
              width="50"
              height="50"
              :src="item.app_image_road"
            />
            <span class="concla1-1-1">{{ item.app_name }}</span>
            <span class="concla1-1-2"
              >下载次数：{{ item.app_downloding_times }}</span
            >
          </div>
        </div>
      </van-tab>
    </van-tabs>
  </div>
</template>
<script>
import http from '../api/index';
export default {
  data() {
    return {
      list: [],
      active: 0,
      digitalList: [],
      topicList: [],
    };
  },
  mounted() {
    http
      .myFollow({
        user_id: 1,
        follow_type: 0,
      })
      .then((r) => {
        console.log(r);
        this.list = r.data;
      });
    http
      .myFollow({
        user_id: 1,
        follow_type: 0,
      })
      .then((r) => {
        console.log(r);
        this.digitalList = r.data;
      });
    http
      .myFollow({
        user_id: 1,
        follow_type: 0,
      })
      .then((r) => {
        console.log(r);
        this.topicList = r.data;
      });
  },
  methods: {
    onClickLeft() {
      this.$router.push('/mine');
    },
    onClick(name) {
      console.log(name);
    },
  },
};
</script>
<style scoped>
.head {
  width: 100%;
  height: 4rem;
  background-color: rgb(108, 144, 243);
}
.text {
  text-align: center;
  font-size: 1.6rem;
  color: whitesmoke;
  line-height: 4rem;
}
.icon {
  position: absolute;
  top: 1.1rem;
  /* left: 0px; */
}
.msg {
  width: 18rem;
  height: 10rem;
  margin: 0 auto;
  margin-top: 10rem;
}
.concla1 {
  width: 96%;
  margin: 0 auto;
  border-radius: 1.5rem;
  background-color: white;
}
.concla1-1 {
  width: 96%;
  height: 6rem;
  position: relative;
  margin-top: 2rem;
}
.conbtn1 {
  position: absolute;
  top: 0.8rem;
  right: 0px;
  width: 7rem;
}
.concla1-1-1 {
  position: absolute;
  top: 0.1rem;
  left: 8.5rem;
  font-size: 1.8rem;
  color: #252525;
}
.concla1-1-2 {
  position: absolute;
  top: 3rem;
  left: 8.5rem;
  font-size: 1.4rem;
  color: #7a7a7a;
}
</style>